﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using simpleHotel.Client.HotelReference;

namespace simpleHotel.Client.UserControls
{
    public partial class ucBookingList2 : BaseUserControl
    {
        public ucBookingList2()
        {
            InitializeComponent();
        }

        private void ucBookingList2_Load(object sender, EventArgs e)
        {
            GetData();    

            this.timer1.Enabled = true;
            this.timer1.Start();
        }

        private void GetData() 
        {
            var service = new HotelService();
            var table = service.GetAllBookings();
            this.gridControl1.DataSource = table; 
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            GetData();            
        }
    }
}
